package com.situ.day8homework2;

public class Yinhang {
	int account;
	private String name;
	private String address;
	int balance;
	private int minBalance;
	int cunkuan;
	int qukuan;
	
	
	public Yinhang() {
		super();
	}
	
	public Yinhang(int account, String name, String address, int balance, int minBalance,int cunkuan,int qukuan) {
		super();
		this.account = account;
		this.name = name;
		this.address = address;
		this.balance = balance;
		this.minBalance = minBalance;
		this.cunkuan = cunkuan;
		this.qukuan = qukuan;
	}
	
	public void deposit(){      //加上原钱数无法实现
//		System.out.println("账户原有数额：" + (balance + minBalance) );
		System.out.println("账户原余额：" + balance);
		System.out.println("存款数额： " + cunkuan);
		balance = balance + cunkuan;
//		System.out.println("最终存款数额 " + (balance + cunkuan));
		System.out.println("最终存款数额 " + balance);
	}
	
	public void withdraw(){
		if ((balance - qukuan) < minBalance) {
			System.out.println("取款失败，至少保留： " + minBalance + "元");
			return;
		}
		System.out.println("账户金额： " + balance);
		balance = balance - qukuan;
		System.out.println("账户取款" + qukuan + "\t" + "账户余额" + balance);
	}
	public void query(){
		System.out.println("账户账号为 ： " + account);
		System.out.println("储户姓名为 ： " + name);
		System.out.println("储户地址为：" + address);
		System.out.println("账号余额为：" + balance);
		
	}
	
	public int getAccount() {
		return account;
	}

	public void setAccount(int account) {
		this.account = account;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getBalance() {
		return balance;
	}

	public void setBalance(int balance) {
		this.balance = balance;
	}

	public int getMinBalance() {
		return minBalance;
	}

	public void setMinBalance(int minBalance) {
		this.minBalance = minBalance;
	}

	public int getCunkuan() {
		return cunkuan;
	}

	public void setCunkuan(int cunkuan) {
		this.cunkuan = cunkuan;
	}

	public int getQukuan() {
		return qukuan;
	}

	public void setQukuan(int qukuan) {
		this.qukuan = qukuan;
	}

	@Override
	public String toString() {
		return "Yinhang [account=" + account + ", name=" + name + ", address=" + address + ", balance=" + balance
				+ ", minBalance=" + minBalance + "]";
	}
	
	
}
